import request from '../utils/request'

// 订单相关API接口

export const orderApi = {
  // 获取订单列表
  getOrderList: (params) => request.get('/order/list', { params }),
  
  // 获取订单详情
  getOrderDetail: (id) => request.get(`/order/${id}`),
  
  // 更新订单状态
  updateOrderStatus: (id, status) => request.put(`/order/${id}/status`, { status }),
  
  // 发货订单
  shipOrder: (id, data) => request.put(`/order/${id}/ship`, data),
  
  // 取消订单
  cancelOrder: (id) => request.put(`/order/${id}/cancel`),
  
  // 订单统计
  getOrderStatistics: (params) => request.get('/order/statistics', { params }),
  
  // 导出订单
  exportOrder: (params) => request.get('/order/export', { params, responseType: 'blob' })
}

export default orderApi